package com.dexilaonian.adpter;

import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

/**
 * Created by Administrator on 2018/3/21.
 */

public class ServiceDetailAdaprer extends PagerAdapter {
    private List<View> service_list;
    private Context context;

    public ServiceDetailAdaprer(Context context, List<View> service_list) {
        this.context = context;
        this.service_list =service_list;
    }

    @Override
    public int getCount() {
        return service_list.size();
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return  view== object;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        container.addView(service_list.get(position));
        return service_list.get(position);
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView(service_list.get(position));
     // super.destroyItem(container, position, object);
    }
}
